package com.waitingresult.common.base.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.Version;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * All right reserved,Designed By WangShuai
 *
 * @author : WangShuai
 * @version : V1.0
 * @ClassName : BaseEntity
 * @Description : 所有实体类的父类.
 * @date : 2021/9/7 18:25
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BaseEntity implements Serializable {

    private static final long serialVersionUID = 3728877563912075886L;

    @Version
    @TableField(value = "revision", fill = FieldFill.INSERT)
    @ApiModelProperty(value = "乐观锁")
    private Integer revision;


    @TableField(value = "created_by", fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建人")
    private Long createdBy;


    @TableField(value = "created_time", fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间")
    private Integer createdTime;


    @TableField(value = "updated_by", fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "更新人")
    private Long updatedBy;


    @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
    @ApiModelProperty(value = "更新时间")
    private Integer updatedTime;


    @TableLogic
    @TableField(value = "is_deleted_flag", fill = FieldFill.INSERT)
    @ApiModelProperty(value = "删除标识")
    private Boolean deletedFlag;


    @TableField(value = "deleted_by")
    @ApiModelProperty(value = "删除人")
    private Long deletedBy;


    @TableField(value = "deleted_time")
    @ApiModelProperty(value = "删除时间")
    private Integer deletedTime;

    /* ========================= 以下非表字段 ========================= */
}
